package tugas.akhir.jason;

import java.text.SimpleDateFormat;
import java.util.Date;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.telephony.TelephonyManager;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class dr01_fasilitasumum extends Activity{
	Button next_button2;
	EditText alamat=null;
	EditText namafasilitasumum=null;
	EditText alamatfasilitasumum=null;
	String almagId=null;
	private String fIdLaporan, labelId;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.dr01_fasilitasumum);
		
		alamat=(EditText)findViewById(R.id.dr1_alamat);
		
		TelephonyManager telephonyManager = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);
        variabelstatis.imeii = telephonyManager.getDeviceId();
		
		 //tanggal
        SimpleDateFormat sdf = new SimpleDateFormat ("ddMMyy-HHmm");
        fIdLaporan =  "" + variabelstatis.imeii + "-" + sdf.format (new Date ());
        
        variabelstatis.timestamp = "" + sdf.format (new Date ());
        
        TextView rid = (TextView) findViewById (R.id.dr1_reportid_label);
        labelId = "ID Laporan: "  + fIdLaporan;
        rid.setText (labelId);
		
        variabelstatis.idglobal = fIdLaporan;
		
		next_button2 = (Button) findViewById(R.id.next_button2);
		next_button2.setOnClickListener(onSave);}

	
	private View.OnClickListener onSave=new View.OnClickListener() {
		public void onClick(View v) {

			namafasilitasumum=(EditText)findViewById(R.id.dr01_namafasilitasumum);
			variabelstatis.dr01_namafasilitasumum = (namafasilitasumum.getText().toString());
			
			alamatfasilitasumum=(EditText)findViewById(R.id.dr01_alamatfasilitasumum);
			variabelstatis.dr01_alamatfasilitasumum = (alamatfasilitasumum.getText().toString());
			
			variabelstatis.headerdata = "" + variabelstatis.timestamp + " - " + variabelstatis.dr01_namafasilitasumum;
			variabelstatis.jenisbangunan = "fasilitasumum";
			
			{ startActivity(new Intent(dr01_fasilitasumum.this,dr4_penyebabkerusakan.class)); }
			
		}
	};
}